function editCart(cartItemId, buyCount) {
    window.location.href = 'cart.do?operate=editCart&cartItemId=' + cartItemId + "&buyCount=" + buyCount;
}

window.onload = function () {
    var vue = new Vue({
        el: "#cart_div",
        data: {
            cart: {}
        },
        methods: {
            getCart: function () {
                axios({
                    baseURL: "http://localhost:8080/",
                    method: "POST",
                    url: "book/cart.do",
                    params: {
                        operate: 'cartInfo'
                    }
                }).then(function (value) {
                    console.log(value.data);
                    var cart = value.data;
                    vue.cart = cart;
                })
                    .catch(function (err) {
                    });
            },
            editCart(cartItemId, buyCount) {
                axios({
                    baseURL: "http://localhost:8080/",
                    method: "POST",
                    url: "book/cart.do",
                    params: {
                        operate: 'editCart',
                        cartItemId: cartItemId,
                        buyCount: buyCount
                    }
                }).then(function (value) {
                    vue.getCart();
                })
                    .catch(function (err) {
                    });
            }
        },
        mounted() {
            this.getCart();
        }
    })
}